
package com.jf.cloud.api.user.feign;

import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.order.vo.ShopCartOrderMergerVO;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 用户等级积分订单计算feign连接
 * @author zz
 * @date 2021/05/10
 */
@FeignClient(value = "jfcloud-user",contextId = "user-level-and-score")
public interface UserLevelAndScoreOrderFeignClient {


    /**
     * 计算订单等级和积分优惠
     * @param shopCartOrderMerger 订单信息
     * @return
     */
    @PostMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/userLevel/calculateLevelAndScoreDiscount")
    ServerResponseEntity<ShopCartOrderMergerVO> calculateLevelAndScoreDiscount(@RequestBody ShopCartOrderMergerVO shopCartOrderMerger);

    /**
     * 获取财务对账退款积分
     * @param refundIds
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_INSIDER_URL_PREFIX + "/userLevel/getScoreCount")
    ServerResponseEntity<Long> getScoreCount(@RequestBody List<Long> refundIds);

    /**
     * 获取该用户是否具有平台会员包邮权益
     * @param userId
     * @param shopId
     * @return
     */
    @GetMapping(FeignInsideAuthConfig.FEIGN_INSIDER_URL_PREFIX + "/userLevel/getHaveFreeFeeRight")
    ServerResponseEntity<Boolean> getHaveFreeFeeRight(@RequestParam("userId") Long userId, @RequestParam("shopId") Long shopId);
}
